package online.longzipeng.modules.app.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import online.longzipeng.common.service.impl.CrudServiceImpl;
import online.longzipeng.modules.app.dao.BookDao;
import online.longzipeng.modules.app.dto.BookDTO;
import online.longzipeng.modules.app.entity.BookEntity;
import online.longzipeng.modules.app.service.BookService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.0.0 2023-04-08
 */
@Service
public class BookServiceImpl extends CrudServiceImpl<BookDao, BookEntity, BookDTO> implements BookService {

    @Override
    public QueryWrapper<BookEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");

        QueryWrapper<BookEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(id), "id", id);

        return wrapper;
    }


}